package com.teach.service.impl;

import com.teach.entity.Role;
import com.teach.mapper.RoleMapper;
import com.teach.service.RoleService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <pre>
 * TODO : 业务逻辑实现类
 * 系统角色
 * ClassName : com.teach.service.impl.RoleServiceImpl
 * Author : J.L.Zhou
 * Tel : 15111047708
 * E-Mail : 12020042@qq.com
 * Date : 2020-05-02 13:14
 * Version : 1.0
 * </pre>
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

	@Override
	public QueryWrapper<Role> getQueryWrapper(Role role) {
		QueryWrapper<Role> queryWrapper = new QueryWrapper<Role>();
		if(role.getRoleId() != null) {
			queryWrapper.eq("ROLE_ID", role.getRoleId());
		}
		if(role.getRoleCode() != null) {
			queryWrapper.eq("ROLE_CODE", role.getRoleCode());
		}
		if(role.getRoleName() != null) {
			queryWrapper.eq("ROLE_NAME", role.getRoleName());
		}
		return queryWrapper;
	}
	

}
